<% layout("/common/layout.html",{"title":"资源菜单"}){ %>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-8">
        <h2>会员资源</h2>
        <ol class="breadcrumb">
            <li><a href="${ctxPath}/admin/main">主页</a></li>
            <li><a>会员权限管理</a></li>
            <li class="active">会员资源</li>
        </ol>
    </div>
    <div class="col-sm-4">
        <div class="title-action">
        </div>
    </div>
</div>

<div class="wrapper wrapper-content">
    <div class="row">
        <!-- 分类树  -->
        <div class="col-lg-2">
            <div class="ibox float-e-margins">
                <div class="ibox-content mailbox-content">
                    <div class="file-manager">
                        <div class="topTreeBanner style navy-bg">
                            <h3><i class="fa fa-slack"></i> 资源菜单导航</h3>
                        </div>
                        <div class="space-25"></div>
                        <ul class="folder-list-none m-b-md">
                            <li><a class="btn-sm btn-outline btn-link" href="javascript:;" id="allResList"> <i
                                    class="fa fa-bars"></i>显示全部</a></li>
                            <ul id="navTree" class="ztree"></ul>
                        </ul>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 分类树  -->
        <!-- 表格-->
        <div class="col-lg-10 animated fadeIn">
            <div class="mail-box">
                <div class="ibox-content">
                    <table id="userResList"></table>
                    <div class="toolBar" style="margin:0 -15px;">
                        <div class="col-sm-8">
                            <div class="btn-group">
                                <% if(shiro.hasPermission("/userRes/save/action")){ %>
                                <a class="btn btn-primary btn-outline toolbar-save"><i class="fa fa-plus-square"> </i>
                                    添加</a>
                                <% } %>
                                <a class="btn btn-primary btn-outline toolbar-refresh"><i class="fa fa-refresh"> </i> 刷新</a>
                                <% if(shiro.hasPermission("/userRes/status/action")){ %>
                                <a class="btn btn-primary btn-outline toolbar-batchStatus"><i class="fa fa-gear"> </i>
                                    批量更改状态</a>
                                <% } %>
                                <% if(shiro.hasPermission("/userRes/delete/action")){ %>
                                <a class="btn btn-primary btn-outline toolbar-batchDelete"><i class="fa fa-trash"> </i> 批量删除</a>
                                <% } %>
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="input-group">
                                <input type="text" placeholder="请输入名称或标示关键词" class="form-control searchValue">
												<span class="input-group-btn"> 
                                   				 <button type="button" id="search" class="btn btn-primary"><i
                                                         class="fa fa-search"></i>&nbsp;搜索
                                                 </button>
                                   				</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 表格-->
    </div>
</div>
<% } %>
<script type="text/javascript">
    //页面JS调用
    require([ 'user/res'], function (res) {
        res.list();
    });
    //列表参数
    function operateFormatter(value, row, index) {
        var tempCode = "";
        <% if(shiro.hasPermission("/userRes/status/action")){ %>
        if (row.status == 1) {
            tempCode += '<button type="button" class="status btn btn-white btn-xs"><i class="fa fa-ban"></i>&nbsp;禁用&nbsp;</button>';
        }
        else {
            tempCode += '<button type="button" class="status btn btn-white btn-xs"><i class="fa fa-check"></i>&nbsp;启用&nbsp;</button>';
        }
        <% } %>
        <% if(shiro.hasPermission("/userRes/save/action")){ %>
        tempCode += '<button type="button" class="update btn btn-white btn-xs"><i class="fa fa-pencil"></i>&nbsp;编辑&nbsp;</button>';
        <% } %>
        <% if(shiro.hasPermission("/userRes/delete/action")){ %>
            tempCode += '<button type="button" class="delete btn btn-white btn-xs">&nbsp;<i class="fa fa-trash"></i>&nbsp;删除&nbsp;</button>';
        <% } %>
        return '<div class="btn-group">' + tempCode + '</div>';
    }
</script>